//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.alibaba.nacos.consistency.entity;

import com.google.protobuf.AbstractParser;
import com.google.protobuf.ByteString;
import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.Descriptors;
import com.google.protobuf.ExtensionRegistryLite;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.Internal;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import com.google.protobuf.Parser;
import com.google.protobuf.UnknownFieldSet;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;

public final class Response extends GeneratedMessageV3 implements ResponseOrBuilder {
    private static final long serialVersionUID = 0L;
    public static final int DATA_FIELD_NUMBER = 1;
    private ByteString data_;
    public static final int ERRMSG_FIELD_NUMBER = 2;
    private volatile Object errMsg_;
    public static final int SUCCESS_FIELD_NUMBER = 3;
    private boolean success_;
    private byte memoizedIsInitialized;
    private static final Response DEFAULT_INSTANCE = new Response();
    private static final Parser<Response> PARSER = new AbstractParser<Response>() {
        public Response parsePartialFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return new Response(input, extensionRegistry);
        }
    };

    private Response(GeneratedMessageV3.Builder<?> builder) {
        super(builder);
        this.memoizedIsInitialized = -1;
    }

    private Response() {
        this.memoizedIsInitialized = -1;
        this.data_ = ByteString.EMPTY;
        this.errMsg_ = "";
    }

    protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) {
        return new Response();
    }

    public final UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
    }

    private Response(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        this();
        if (extensionRegistry == null) {
            throw new NullPointerException();
        } else {
            UnknownFieldSet.Builder unknownFields = UnknownFieldSet.newBuilder();

            try {
                boolean done = false;

                while(!done) {
                    int tag = input.readTag();
                    switch (tag) {
                        case 0:
                            done = true;
                            break;
                        case 10:
                            this.data_ = input.readBytes();
                            break;
                        case 18:
                            String s = input.readStringRequireUtf8();
                            this.errMsg_ = s;
                            break;
                        case 24:
                            this.success_ = input.readBool();
                            break;
                        default:
                            if (!this.parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                                done = true;
                            }
                    }
                }
            } catch (InvalidProtocolBufferException var11) {
                throw var11.setUnfinishedMessage(this);
            } catch (IOException var12) {
                throw (new InvalidProtocolBufferException(var12)).setUnfinishedMessage(this);
            } finally {
                this.unknownFields = unknownFields.build();
                this.makeExtensionsImmutable();
            }

        }
    }

    public static final Descriptors.Descriptor getDescriptor() {
        return Consistency.internal_static_Response_descriptor;
    }

    protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() {
        return Consistency.internal_static_Response_fieldAccessorTable.ensureFieldAccessorsInitialized(Response.class, Builder.class);
    }

    public ByteString getData() {
        return this.data_;
    }

    public String getErrMsg() {
        Object ref = this.errMsg_;
        if (ref instanceof String) {
            return (String)ref;
        } else {
            ByteString bs = (ByteString)ref;
            String s = bs.toStringUtf8();
            this.errMsg_ = s;
            return s;
        }
    }

    public ByteString getErrMsgBytes() {
        Object ref = this.errMsg_;
        if (ref instanceof String) {
            ByteString b = ByteString.copyFromUtf8((String)ref);
            this.errMsg_ = b;
            return b;
        } else {
            return (ByteString)ref;
        }
    }

    public boolean getSuccess() {
        return this.success_;
    }

    public final boolean isInitialized() {
        byte isInitialized = this.memoizedIsInitialized;
        if (isInitialized == 1) {
            return true;
        } else if (isInitialized == 0) {
            return false;
        } else {
            this.memoizedIsInitialized = 1;
            return true;
        }
    }

    public void writeTo(CodedOutputStream output) throws IOException {
        if (!this.data_.isEmpty()) {
            output.writeBytes(1, this.data_);
        }

        if (!this.getErrMsgBytes().isEmpty()) {
            GeneratedMessageV3.writeString(output, 2, this.errMsg_);
        }

        if (this.success_) {
            output.writeBool(3, this.success_);
        }

        this.unknownFields.writeTo(output);
    }

    public int getSerializedSize() {
        int size = this.memoizedSize;
        if (size != -1) {
            return size;
        } else {
            size = 0;
            if (!this.data_.isEmpty()) {
                size += CodedOutputStream.computeBytesSize(1, this.data_);
            }

            if (!this.getErrMsgBytes().isEmpty()) {
                size += GeneratedMessageV3.computeStringSize(2, this.errMsg_);
            }

            if (this.success_) {
                size += CodedOutputStream.computeBoolSize(3, this.success_);
            }

            size += this.unknownFields.getSerializedSize();
            this.memoizedSize = size;
            return size;
        }
    }

    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        } else if (!(obj instanceof Response)) {
            return super.equals(obj);
        } else {
            Response other = (Response)obj;
            if (!this.getData().equals(other.getData())) {
                return false;
            } else if (!this.getErrMsg().equals(other.getErrMsg())) {
                return false;
            } else if (this.getSuccess() != other.getSuccess()) {
                return false;
            } else {
                return this.unknownFields.equals(other.unknownFields);
            }
        }
    }

    public int hashCode() {
        if (this.memoizedHashCode != 0) {
            return this.memoizedHashCode;
        } else {
            int hash = 41;
            hash = 19 * hash + getDescriptor().hashCode();
            hash = 37 * hash + 1;
            hash = 53 * hash + this.getData().hashCode();
            hash = 37 * hash + 2;
            hash = 53 * hash + this.getErrMsg().hashCode();
            hash = 37 * hash + 3;
            hash = 53 * hash + Internal.hashBoolean(this.getSuccess());
            hash = 29 * hash + this.unknownFields.hashCode();
            this.memoizedHashCode = hash;
            return hash;
        }
    }

    public static Response parseFrom(ByteBuffer data) throws InvalidProtocolBufferException {
        return (Response)PARSER.parseFrom(data);
    }

    public static Response parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return (Response)PARSER.parseFrom(data, extensionRegistry);
    }

    public static Response parseFrom(ByteString data) throws InvalidProtocolBufferException {
        return (Response)PARSER.parseFrom(data);
    }

    public static Response parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return (Response)PARSER.parseFrom(data, extensionRegistry);
    }

    public static Response parseFrom(byte[] data) throws InvalidProtocolBufferException {
        return (Response)PARSER.parseFrom(data);
    }

    public static Response parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return (Response)PARSER.parseFrom(data, extensionRegistry);
    }

    public static Response parseFrom(InputStream input) throws IOException {
        return (Response)GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static Response parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException {
        return (Response)GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static Response parseDelimitedFrom(InputStream input) throws IOException {
        return (Response)GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static Response parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException {
        return (Response)GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }

    public static Response parseFrom(CodedInputStream input) throws IOException {
        return (Response)GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static Response parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException {
        return (Response)GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() {
        return newBuilder();
    }

    public static Builder newBuilder() {
        return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(Response prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    public Builder toBuilder() {
        return this == DEFAULT_INSTANCE ? new Builder() : (new Builder()).mergeFrom(this);
    }

    protected Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
    }

    public static Response getDefaultInstance() {
        return DEFAULT_INSTANCE;
    }

    public static Parser<Response> parser() {
        return PARSER;
    }

    public Parser<Response> getParserForType() {
        return PARSER;
    }

    public Response getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
    }

    public static final class Builder extends GeneratedMessageV3.Builder<Builder> implements ResponseOrBuilder {
        private ByteString data_;
        private Object errMsg_;
        private boolean success_;

        public static final Descriptors.Descriptor getDescriptor() {
            return Consistency.internal_static_Response_descriptor;
        }

        protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() {
            return Consistency.internal_static_Response_fieldAccessorTable.ensureFieldAccessorsInitialized(Response.class, Builder.class);
        }

        private Builder() {
            this.data_ = ByteString.EMPTY;
            this.errMsg_ = "";
            this.maybeForceBuilderInitialization();
        }

        private Builder(GeneratedMessageV3.BuilderParent parent) {
            super(parent);
            this.data_ = ByteString.EMPTY;
            this.errMsg_ = "";
            this.maybeForceBuilderInitialization();
        }

        private void maybeForceBuilderInitialization() {
            if (Response.alwaysUseFieldBuilders) {
            }

        }

        public Builder clear() {
            super.clear();
            this.data_ = ByteString.EMPTY;
            this.errMsg_ = "";
            this.success_ = false;
            return this;
        }

        public Descriptors.Descriptor getDescriptorForType() {
            return Consistency.internal_static_Response_descriptor;
        }

        public Response getDefaultInstanceForType() {
            return Response.getDefaultInstance();
        }

        public Response build() {
            Response result = this.buildPartial();
            if (!result.isInitialized()) {
                throw newUninitializedMessageException(result);
            } else {
                return result;
            }
        }

        public Response buildPartial() {
            Response result = new Response(this);
            result.data_ = this.data_;
            result.errMsg_ = this.errMsg_;
            result.success_ = this.success_;
            this.onBuilt();
            return result;
        }

        public Builder clone() {
            return (Builder)super.clone();
        }

        public Builder setField(Descriptors.FieldDescriptor field, Object value) {
            return (Builder)super.setField(field, value);
        }

        public Builder clearField(Descriptors.FieldDescriptor field) {
            return (Builder)super.clearField(field);
        }

        public Builder clearOneof(Descriptors.OneofDescriptor oneof) {
            return (Builder)super.clearOneof(oneof);
        }

        public Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value) {
            return (Builder)super.setRepeatedField(field, index, value);
        }

        public Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value) {
            return (Builder)super.addRepeatedField(field, value);
        }

        public Builder mergeFrom(Message other) {
            if (other instanceof Response) {
                return this.mergeFrom((Response)other);
            } else {
                super.mergeFrom(other);
                return this;
            }
        }

        public Builder mergeFrom(Response other) {
            if (other == Response.getDefaultInstance()) {
                return this;
            } else {
                if (other.getData() != ByteString.EMPTY) {
                    this.setData(other.getData());
                }

                if (!other.getErrMsg().isEmpty()) {
                    this.errMsg_ = other.errMsg_;
                    this.onChanged();
                }

                if (other.getSuccess()) {
                    this.setSuccess(other.getSuccess());
                }

                this.mergeUnknownFields(other.unknownFields);
                this.onChanged();
                return this;
            }
        }

        public final boolean isInitialized() {
            return true;
        }

        public Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException {
            Response parsedMessage = null;

            try {
                parsedMessage = (Response)Response.PARSER.parsePartialFrom(input, extensionRegistry);
            } catch (InvalidProtocolBufferException var8) {
                parsedMessage = (Response)var8.getUnfinishedMessage();
                throw var8.unwrapIOException();
            } finally {
                if (parsedMessage != null) {
                    this.mergeFrom(parsedMessage);
                }

            }

            return this;
        }

        public ByteString getData() {
            return this.data_;
        }

        public Builder setData(ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            } else {
                this.data_ = value;
                this.onChanged();
                return this;
            }
        }

        public Builder clearData() {
            this.data_ = Response.getDefaultInstance().getData();
            this.onChanged();
            return this;
        }

        public String getErrMsg() {
            Object ref = this.errMsg_;
            if (!(ref instanceof String)) {
                ByteString bs = (ByteString)ref;
                String s = bs.toStringUtf8();
                this.errMsg_ = s;
                return s;
            } else {
                return (String)ref;
            }
        }

        public ByteString getErrMsgBytes() {
            Object ref = this.errMsg_;
            if (ref instanceof String) {
                ByteString b = ByteString.copyFromUtf8((String)ref);
                this.errMsg_ = b;
                return b;
            } else {
                return (ByteString)ref;
            }
        }

        public Builder setErrMsg(String value) {
            if (value == null) {
                throw new NullPointerException();
            } else {
                this.errMsg_ = value;
                this.onChanged();
                return this;
            }
        }

        public Builder clearErrMsg() {
            this.errMsg_ = Response.getDefaultInstance().getErrMsg();
            this.onChanged();
            return this;
        }

        public Builder setErrMsgBytes(ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            } else {
                Response.checkByteStringIsUtf8(value);
                this.errMsg_ = value;
                this.onChanged();
                return this;
            }
        }

        public boolean getSuccess() {
            return this.success_;
        }

        public Builder setSuccess(boolean value) {
            this.success_ = value;
            this.onChanged();
            return this;
        }

        public Builder clearSuccess() {
            this.success_ = false;
            this.onChanged();
            return this;
        }

        public final Builder setUnknownFields(UnknownFieldSet unknownFields) {
            return (Builder)super.setUnknownFields(unknownFields);
        }

        public final Builder mergeUnknownFields(UnknownFieldSet unknownFields) {
            return (Builder)super.mergeUnknownFields(unknownFields);
        }
    }
}
